//获取应用实例
const app = getApp()

Component({
  properties: {
    
    clickClockstate: {
      type: Boolean,
      value: false,
      observer(newValue, oldValue) {
        this.setData({
          title: newValue ? '今日已打卡' : '今日未打卡'
        })
      }
    },

    adminState: {
      type:Boolean,
      value:false
    },

    header:{
      type: Object,
      value: {},
      observer(newValue, oldValue) {
        if ( JSON.stringify(newValue) != '{}' && !!newValue ) {
          this.setData({
            header: newValue
          })
        } else {
          this.setData({
            header: app.globalData.headerInfo
          })
        }
      }
    }
  },
  data: {
    title:"今日未打卡",
    setHeight:0
    // popupState:true
  },
  methods: {
    ClockFn(){
      wx.navigateTo({
        url: `/pages/myInfo/myInfo?isBankAdmin=${this.data.adminState}&avatarUrl=${this.data.header.avatarUrl}&name=${this.data.header.name}&uId=${this.data.header.uId}`
      })
    }
  },

  attached() {
    var self = this
    wx.getSystemInfo({
      success(res) {
        self.setData({
          setHeight: res.statusBarHeight
        })
      }
    })
  }
})